from __future__ import annotations

from dataclasses import dataclass


@dataclass
class SealingNetTension:
    initial_tension_kN: float
    max_accident_tension_kN: float
    note: str


def calculate_sealing_net_tension(span_m: float, unit_weight_kN_m: float, safety_factor: float = 2.0, accident_factor: float = 1.5) -> SealingNetTension:
    """封网（杆）张力：按跨中均布载近似，初张力为自重比例，事故乘以系数。"""

    T0 = unit_weight_kN_m * span_m * 0.25
    Tmax = T0 * accident_factor * safety_factor
    return SealingNetTension(initial_tension_kN=T0, max_accident_tension_kN=Tmax, note="按比例估算，现场张拉复核")


